package ch.janotta.slawo.ultraquest.rulesets;

import java.util.Arrays;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ch.janotta.slawo.ultraquest.types.Area;

public class HumanRuleset implements SpeciesRuleset {
  private static final Logger LOGGER = LoggerFactory.getLogger(HumanRuleset.class);

  @Override
  public int getMaximumSpeed() {
    return 4;
  }

  @Override
  public int getMaximumStrength() {
    return 4;
  }

  @Override
  public int getMaximumDexterity() {
    return 4;
  }

  @Override
  public int getMaximumIntelligence() {
    return 4;
  }

  @Override
  public int getInitialSpeed() {
    return 3;
  }

  @Override
  public int getInitialStrength() {
    return 2;
  }

  @Override
  public int getInitialDexterity() {
    return 2;
  }

  @Override
  public int getInitialIntelligence() {
    return 2;
  }

  @Override
  public int getCostOfNextSpeedLevel(int currentLevel) {
    int cost = 999;
    if (currentLevel == 3) {
      cost = 5;
    } else {
      LOGGER.error("Humans cannot advance speed from level {} to {}", currentLevel, currentLevel + 1);
    }
    return cost;
  }

  @Override
  public int getCostOfNextStrengthLevel(int currentLevel) {
    int cost = 999;
    if (currentLevel == 2) {
      cost = 2;
    } else if (currentLevel == 3) {
      cost = 4;
    } else {
      LOGGER.error("Humans cannot advance strength from level {} to {}", currentLevel, currentLevel + 1);
    }
    return cost;
  }

  @Override
  public int getCostOfNextDexterityLevel(int currentLevel) {
    int cost = 999;
    if (currentLevel == 2) {
      cost = 2;
    } else if (currentLevel == 3) {
      cost = 5;
    } else {
      LOGGER.error("Humans cannot advance dexterity from level {} to {}", currentLevel, currentLevel + 1);
    }
    return cost;
  }

  @Override
  public int getCostOfNextIntelligenceLevel(int currentLevel) {
    int cost = 999;
    if (currentLevel == 2) {
      cost = 2;
    } else if (currentLevel == 3) {
      cost = 5;
    } else {
      LOGGER.error("Humans cannot advance intelligence from level {} to {}", currentLevel, currentLevel + 1);
    }
    return cost;
  }

  @Override
  public List<Area> getInitialNativeAreas() {
    return Arrays.asList(new Area[] {Area.MARSH});
  }
}
